var typeorm = require("typeorm");
var mysql2 = require("mysql2");

var dataSource = new typeorm.DataSource({
  type: "mysql",
  host: "localhost",
  port: 3306,
  username: "believer",
  password: "123456",
  database: "test",
  synchronize: true,
  entities: [require("./entity/post"), require("./entity/category")],
  driver: mysql2, // 使用 mysql2
});

module.exports = { dataSource };
